"""
@author: tk
@file: 激活码.py
@time: 2022/11/24 20:22
"""
import random
import string

activationCode = string.ascii_uppercase + '0123456789'  #一串字符串,相当于shell的0-Z


def tiankai(num, length):
    with open("激活码.txt", "w")as fp:
        for i in range(num):
            code = ''
            for j in range(length):
                code += random.choice(activationCode)
            fp.write(code + '\n')


n = int(input("请输入想生成的激活码个数:"))
tiankai(n, 32)
